home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / util / cli / cmp.lha / CMP / rexxc / dopus / cmp_2view.dopus next >
Encoding:
Text File  |  1995-01-04  |  1.7 KB  |  70 lines

  1. /*
  2.  $VER: cmp_2view.dopus 2.92 (95.01.04 18:39:04)
  3.  
  4.  Funktion: Dies ist ein Rexx-Script für DOpus4.0+. Mit Hilfe von CMP kann
  5.    man zwei Files im linken und rechten Window vergleichen. CMP ist auch
  6.    direkt bei mir zu beziehen.
  7.  
  8.  Benötigt werden:
  9.    CMP
  10.    DOpus 4.0+ runing
  11.  
  12.  Aufruf: RX CMP.DOPUS [ARG 1-3]
  13.    ARG = zur Zeit werden drei Argumente von CMP unterstützt
  14.    ARG.QQuick, hat noch eine besondere Funktion. Es werden alle files
  15.      selectiert, die ungleich sind.
  16.    Quellpath mit selectierten Files
  17.    Destpath mit selectierten Files
  18.    Outputwindow
  19.    bei ARG.QQuick auch asyncron
  20.  
  21.  Programmierer: Lutz Hanke, Dorfstr. 43, 01825 Breitenau, Germany
  22. */
  23.  
  24.  
  25. OPTIONS RESULTS
  26. ADDRESS 'DOPUS.1'
  27.  
  28. parse upper arg arg.1
  29.  
  30. 'Status 3'                /* aktives Fenster feststellen */
  31. active = RESULT
  32. inactive = active && 1
  33.  
  34. 'status 13' inactive
  35. dest_path = result
  36. 'status 13' active
  37. from_path = result
  38.  
  39. 'Getselectedfiles /' active
  40. if result ~= 'RESULT' then do
  41.   buffer1 = result
  42.   'Getselectedfiles /' inactive
  43.   if result ~= 'RESULT' then do
  44.     buffer2 = result
  45.     if pos('QQUICK',arg.1) >0 then do
  46.       'None'
  47.       'OtherWindow'
  48.       'None'
  49.       'OtherWindow'
  50.     end
  51.     do while buffer1 ~= ''
  52.       PARSE VAR buffer1 file1'/'buffer1
  53.       PARSE VAR buffer2 file2'/'buffer2
  54.       say '0a'X || 'compare ' left(file1,30) file2
  55.       address 'COMMAND' 'cmp "'from_path || file1'" "'dest_path || file2'"' arg.1
  56.       if (pos('QQUICK',arg.1)>0) & (rc = 0) then do
  57.         'SelectFile "'file1'" 1 1'
  58.         'OtherWindow'
  59.         'SelectFile "'file2'" 1 1'
  60.         'OtherWindow'
  61.       end
  62.     end
  63.   end
  64.   else 'request kein file im inactiven window'
  65. end
  66. else 'request kein file im activen window'
  67.  
  68. exit 0
  69.  
  70.